<?php

namespace App\Modules\Admin\Entities\Log;

use App\Models\Model;

class WaterDeviceLogModel extends Model
{

    protected $table='water_device_log';
    protected $primaryKey='id';

    public function addLog($param)
    {

        $create =[
            'user_id'=>$param['user_id'],
            'date'=>date('Y-m-d H:i:s'),
            'month'=>date('Y-m-d'),
            'water_id'=>$param['water_id'],
            'water_title'=>$param['water_title'],
            'status'=>$param['status'],
            'remark'=>json_encode($param['remark'],JSON_UNESCAPED_UNICODE),
            'msg'=>$param['msg']
        ];
       $info = $this->create($create);
       return $info->id??0;
    }

}
